package com.study.experiment02.entity;

import java.util.Arrays;

public class UserBean {
    /**
     * 姓名、学号、登录密码、性别、年龄、籍贯、选修课程以及个人简介
     */
    private String name;
    private String stuNo;
    private String pwd;
    private boolean sex;
    private String sexStr;
    private int age;
    private String birthplace;
    private String[] electives;
    private String detail;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStuNo() {
        return stuNo;
    }

    public void setStuNo(String stuNo) {
        this.stuNo = stuNo;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public boolean isSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    public String getSexStr() {
        return sex ? "男" : "女";
    }

    public void setSexStr(String sexStr) {
        this.sexStr = sexStr;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getBirthplace() {
        return birthplace;
    }

    public void setBirthplace(String birthplace) {
        this.birthplace = birthplace;
    }

    public String[] getElectives() {
        return electives;
    }

    public void setElectives(String[] electives) {
        this.electives = electives;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "name='" + name + '\'' +
                ", stuNo='" + stuNo + '\'' +
                ", pwd='" + pwd + '\'' +
                ", sexStr='" + getSexStr() + '\'' +
                ", age=" + age +
                ", birthplace='" + birthplace + '\'' +
                ", electives=" + Arrays.toString(electives) +
                ", detail='" + detail + '\'' +
                '}';
    }
}
